/**
 *
 */
package com.binance.notification.web.enums;

import com.binance.master.enums.BaseEnum;

/**
 * ChannelEnum 消息发送渠道
 *
 * @author louis
 * @date 2018-03-15 11:27:55
 */
public enum ChannelEnum implements BaseEnum {

    APP("app", "Android And Ios App"),
    IOS("ios", "IOS App"),
    ANDROID("android", "Android App"),
    PC("pc", "PC客户端"),
    WEB("web", "Web端"),
    ALL("all", "所有");

    private String code;
    private String desc;

    ChannelEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ChannelEnum from(String code) {

        for (ChannelEnum channelEnum : ChannelEnum.values()) {
            if (channelEnum.code.equals(code)) {
                return channelEnum;
            }
        }
        return null;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return this.code;
    }
}
